<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            padding-top: 100px;/*让body里面的图片往下移动100 不然被盖上*/
        }
        #d1{
            width: 1000px;
            height: 100px;
            background-color: red;
            /*固定定位,元素脱离文档流 后面元素顶上来*/
            position: fixed;
            top: 0;
        }
        #d2{
            width: 40px;
            height: 200px;
            background-color: blue;
            position: fixed;
            right: 10px;
            bottom: 50px;
        }
    </style>
</head>
<body>
<div id="d1"></div>
<div id="d2"></div>
<img src="../b.jpg" alt="">
<img src="../b.jpg" alt="">
<img src="../b.jpg" alt="">
<img src="../b.jpg" alt="">
<img src="../b.jpg" alt="">
<img src="../b.jpg" alt="">
<img src="../b.jpg" alt="">
</body>
</html>